﻿using System.Collections.Generic;

namespace Multiprocessing.Core.Mathematics.Matrices
{
    public class MatrixRow : MatrixPart
    {
        #region Constructors

        public MatrixRow(IMatrix matrix, int index) 
            : base(matrix, index)
        {
        }

        #endregion

        #region Methods

        protected override IEnumerable<double> GetElements(IMatrix matrix, int index)
        {
            for (int i = 0; i < matrix.ColumnCount; ++i)
            {
                yield return matrix.GetElement(index, i);
            }
        }

        #endregion

        
    }
}
